/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.depaul.se.courseregistration.mdb.p2p;

import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

 
 //@author lmarco

 @MessageDriven(mappedName = "jms/javaee6/Queue", activationConfig = {
 @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
 @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue")
})
public class BillingMessageBean implements MessageListener {
    
    public BillingMessageBean() {
    }
    
    @Override
    public void onMessage(Message message) {
        TextMessage textMessage = (TextMessage) message;
        try {
            System.out.println("BillingMessageBean:" +"\nMessage received: " + "\n" +textMessage.getText());
        } catch (JMSException ex) {
            Logger.getLogger(BillingMessageBean.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
